﻿<UserControl x:Class="MyFinanceManager.PC.ucNewViewPostingRecord"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wpfToolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
      xmlns:app="clr-namespace:MyFinanceManager.PC"
  MinHeight="300" MinWidth="300">
    <UserControl.Resources>
        <DataTemplate x:Key="RecordTemplate">
            <Grid Width="150">
                <Rectangle Fill="{x:Null}" Stroke="White">
                    <Rectangle.BitmapEffect>
                        <OuterGlowBitmapEffect GlowColor="White" />
                    </Rectangle.BitmapEffect>
                </Rectangle>
                <StackPanel Margin="3,3,3,3">
                    <WrapPanel>
                        <TextBlock Text="{Binding Path=Time.DayOfWeek, Mode=OneWay}"  />
  				        <TextBlock Text=" "  />
  				        <TextBlock Text="{Binding Path=Time.Day, Mode=OneWay}"  />
  				        <TextBlock Text="."  />
  				        <TextBlock Text="{Binding Path=Time.Month, Mode=OneWay}"  />
  				        <TextBlock Text="."  />
  				        <TextBlock Text="{Binding Path=Time.Year, Mode=OneWay}"  />
  				        <TextBlock Text=" "  />
  				        <TextBlock Text="{Binding Path=Time.Hour, Mode=OneWay}"  />
  				        <TextBlock Text=":"  />
  				        <TextBlock Text="{Binding Path=Time.Minute, Mode=OneWay}"  />
  			      </WrapPanel>
                    <TextBlock Text="{Binding Path=Amount, StringFormat=C}" TextAlignment="Center" HorizontalAlignment="Stretch"/>
  			  <!--<TextBlock Text="{Binding Path=CategoryName}" Foreground="White"/>-->
               </StackPanel>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="160"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ListBox x:Name="itemsArea" ItemTemplate="{DynamicResource RecordTemplate}" IsSynchronizedWithCurrentItem="True" Background="#3EFFFFFF" SelectionChanged="ListBox_SelectionChanged"/>
        <StackPanel Grid.Column="1" Margin="8,8,8,8">
            <StackPanel x:Name="contentArea" >
                <TextBlock Text="Konto" />
		    <TextBox Text="{Binding Path=AccountName, Mode=Default}"/>
            <TextBlock Text="Kategorie" />
		    <TextBox Text="{Binding Path=CategoryName, Mode=Default}"/>
             <TextBlock Text="Unterkategorie" />
		    <TextBox Text="{Binding Path=SubCategoryName, Mode=Default}"/>
            <TextBlock Text="Beschreibung" />
		    <TextBox Text="{Binding Path=Description, Mode=Default}"/>
            <TextBlock Text="Datum" />
            <wpfToolkit:Calendar x:Name="calender" SelectedDate="{Binding Path=Time, Mode=Default}" SelectionMode="SingleDate" IsTodayHighlighted="False"/>
        </StackPanel>
            <Grid MaxWidth="400">
                <Rectangle Fill="#7FFFFFFF" Stroke="#FF9B1919" RadiusX="31.5" RadiusY="31.5" StrokeThickness="5">
                    <Rectangle.BitmapEffect>
                        <OuterGlowBitmapEffect GlowColor="#FF9B1919"/>
                    </Rectangle.BitmapEffect>
                </Rectangle>
                <app:ucAddNewPosting x:Name="NewPosting" Margin="30,30,30,30"/>
                <Grid VerticalAlignment="Bottom"  Margin="130,30,130,30" Height="40" >
                    <Button Content="hinzufügen" Click="AddNewPosting_Click"/>
                </Grid>
            </Grid>
        </StackPanel>
    </Grid>
</UserControl>
